package ar.edu.unrn.lia.bean.util;

import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.logging.Logger;

import javax.annotation.PostConstruct;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

@ApplicationScoped
@ManagedBean(eager = true)
public class Aplicacion {

	private static final Logger LOGGER = Logger.getLogger(Aplicacion.class
			.getName());
	private String version;
	private String cuentaCaja;
	
	

	public String getCuentaCaja() {
		return cuentaCaja;
	}

	public void setCuentaCaja(String cuentaCaja) {
		this.cuentaCaja = cuentaCaja;
	}

	@PostConstruct
	protected void initialize() {
		ResourceBundle rb;
		try {
			rb = ResourceBundle.getBundle("datos");

			setVersion(rb.getString("application.version"));
			setCuentaCaja(rb.getString("application.cuentacaja"));

		} catch (MissingResourceException e) {
			LOGGER.warning("Resource bundle 'pe-showcase' was not found");
		}
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

}
